package JavaGrammar.TreeScanners;

import java.util.*;
import java.lang.reflect.*;

import SymbolTable.*;
import FlowGraph.*;
import FlowGraph.Nodes.*;
import FlowGraph.EdgeInfo.*;
import FlowGraph.StatementInfo.*;
import JavaGrammar.*;
import util.*;
import db.ClassData;
import FlowGraph.Transformations.*;
import FlowGraph.SSA.*;

import antlr.*;
// $ANTLR 2.7.1: "JavaPrinter.g" -> "JavaPrinter.java"$

import antlr.TreeParser;
import antlr.Token;
import antlr.collections.AST;
import antlr.RecognitionException;
import antlr.ANTLRException;
import antlr.NoViableAltException;
import antlr.MismatchedTokenException;
import antlr.SemanticException;
import antlr.collections.impl.BitSet;
import antlr.ASTPair;
import antlr.collections.impl.ASTArray;


public class JavaPrinter extends antlr.TreeParser
       implements JavaPrinterTokenTypes
 {


    public LinkedList getLines() {
        return _lines;
    }

    public void setCinfo(ClassData info) {
        _currentCInfo = info;
    }
    
    ClassData _currentCInfo;
    Stack cinfoStack = new Stack();

    private LinkedList _lines = new LinkedList();

    private StringBuffer _currentID;
    private StringBuffer _currentModifiers;
    private LinkedList _idList = new LinkedList();
    private int _ntypeArray;
    private String _typeName;
    private String _varInitializer = null;
    private StringBuffer _currentEXPR;
    private String _currentConst;
    private LinkedList _exprList = new LinkedList();
    private Stack _exprStack = new Stack();
    private StringBuffer _arrayIndexing;
    private StringBuffer _methodHead;
    private StringBuffer _currentPar;
    private LinkedList _parList = new LinkedList();
    private String _methodName;
    private StringBuffer _initializer;
    private StringBuffer _currentArrayDecl;
    
    private int _ident = 0;
    private static final int _IDENT_INC = 4;
public JavaPrinter() {
	tokenNames = _tokenNames;
}

	public final void compilationUnit(AST _t) throws RecognitionException {
		
		AST compilationUnit_AST_in = (AST)_t;
		
		try {      // for error handling
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case 3:
			case CLASS_DEF:
			case INTERFACE_DEF:
			case PACKAGE_DEF:
			case IMPORT:
			{
				{
				if (_t==null) _t=ASTNULL;
				switch ( _t.getType()) {
				case PACKAGE_DEF:
				{
					packageDefinition(_t);
					_t = _retTree;
					break;
				}
				case 3:
				case CLASS_DEF:
				case INTERFACE_DEF:
				case IMPORT:
				{
					break;
				}
				default:
				{
					throw new NoViableAltException(_t);
				}
				}
				}
				{
				_loop4:
				do {
					if (_t==null) _t=ASTNULL;
					if ((_t.getType()==IMPORT)) {
						importDefinition(_t);
						_t = _retTree;
					}
					else {
						break _loop4;
					}
					
				} while (true);
				}
				{
				_loop6:
				do {
					if (_t==null) _t=ASTNULL;
					if ((_t.getType()==CLASS_DEF||_t.getType()==INTERFACE_DEF)) {
						typeDefinition(_t);
						_t = _retTree;
					}
					else {
						break _loop6;
					}
					
				} while (true);
				}
				break;
			}
			case OBJBLOCK:
			{
				objBlock(_t);
				_t = _retTree;
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void packageDefinition(AST _t) throws RecognitionException {
		
		AST packageDefinition_AST_in = (AST)_t;
		AST n1 = null;
		
		try {      // for error handling
			AST __t8 = _t;
			n1 = _t==ASTNULL ? null :(AST)_t;
			match(_t,PACKAGE_DEF);
			_t = _t.getFirstChild();
			identifier(_t);
			_t = _retTree;
			
			Line l = new Line("package " + _currentID.toString() +";", 
			n1, null, 2, _ident, _lines.size()); 
			_lines.add(l);
			_t = __t8;
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void importDefinition(AST _t) throws RecognitionException {
		
		AST importDefinition_AST_in = (AST)_t;
		AST n1 = null;
		
		try {      // for error handling
			AST __t10 = _t;
			n1 = _t==ASTNULL ? null :(AST)_t;
			match(_t,IMPORT);
			_t = _t.getFirstChild();
			identifierStar(_t);
			_t = _retTree;
			
				            Line l = new Line("import " + _currentID.toString() + ";", 
					        n1, null, 1, _ident, _lines.size()); 
					    _lines.add(l);
			_t = __t10;
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void typeDefinition(AST _t) throws RecognitionException {
		
		AST typeDefinition_AST_in = (AST)_t;
		AST n1 = null;
		AST n2 = null;
		AST n3 = null;
		AST n4 = null;
		StringBuffer line = new StringBuffer(); boolean isInner = false;
		
		try {      // for error handling
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case CLASS_DEF:
			{
				AST __t12 = _t;
				n1 = _t==ASTNULL ? null :(AST)_t;
				match(_t,CLASS_DEF);
				_t = _t.getFirstChild();
				modifiers(_t);
				_t = _retTree;
				line.append(_currentModifiers.toString() + " class ");
				n2 = (AST)_t;
				match(_t,IDENT);
				_t = _t.getNextSibling();
				
				line.append(n2.getText() + " ");
				
				// Verifico se e uma classe declarada dentro de outra
				
				ClassData ci = _currentCInfo.getInnerClass(_currentCInfo.getName() + "." +
				n2.getText());
				if(ci != null) {
				// Neste caso, e uma classe interna declarada fora de um 
				// metodo. Entao copio o codigo ja gerado.
				// Quando for classe anonima, um uma classe local, ai
				// o codeGen do FlowGraph da conta do recado.
				
				LinkedList code = ci.getCode();
				for(int i = 0;i < code.size();i++) {
				Line l = (Line) code.get(i);
				// Eu duplico a linha, para o numero da linha 
				// ficar correto
				Line newl = l.duplicate();
				newl.setIdent(l.getIdent() + _ident);
				newl.setNumber(_lines.size());
				_lines.add(newl);
				}
				return;
				/*
				cinfoStack.push(_currentCInfo);
				_currentCInfo = ci;
				isInner = true;*/
				}				    
				
				extendsClause(_t);
				_t = _retTree;
				
				if(_idList.size() > 0) {
				line.append("extends ");
				for(int i = 0;i < _idList.size() - 1;i++) {
				String s = (String) _idList.get(i);
				line.append(s + ",");
				}
				String s = (String) _idList.get(_idList.size() - 1);
				line.append(s + " ");
				}
				
				implementsClause(_t);
				_t = _retTree;
				
				if(_idList.size() > 0) {
				line.append("implements ");
				for(int i = 0;i < _idList.size() - 1;i++) {
				String s = (String) _idList.get(i);
				line.append(s + ",");
				}
				String s = (String) _idList.get(_idList.size() - 1);
				line.append(s + " ");
				}
				
				line.append("{");
				Line l = new Line(line.toString(), n1, null, 2, _ident, _lines.size());
				_lines.add(l);
				
				_ident += _IDENT_INC;
				objBlock(_t);
				_t = _retTree;
				
				_ident -= _IDENT_INC;
				Line l2 = new Line("}", null, null, 1, _ident, _lines.size()); 
				_lines.add(l2); 
				/*
				if(isInner) {
				_currentCInfo = (ClassData) cinfoStack.pop();
				} */
				
				
				_t = __t12;
				_t = _t.getNextSibling();
				break;
			}
			case INTERFACE_DEF:
			{
				AST __t13 = _t;
				n3 = _t==ASTNULL ? null :(AST)_t;
				match(_t,INTERFACE_DEF);
				_t = _t.getFirstChild();
				modifiers(_t);
				_t = _retTree;
				line.append(_currentModifiers.toString() + " interface ");
				n4 = (AST)_t;
				match(_t,IDENT);
				_t = _t.getNextSibling();
				line.append(n4.getText() + " ");
				extendsClause(_t);
				_t = _retTree;
				
				if(_idList.size() > 0) {
				line.append("extends ");
				for(int i = 0;i < _idList.size() - 1;i++) {
				String s = (String) _idList.get(i);
				line.append(s + ",");
				}
				String s = (String) _idList.get(_idList.size() - 1);
				line.append(s + " ");
				}
				
				line.append("{");
				Line l = new Line(line.toString(), n3, null, 2, _ident, _lines.size());
				_lines.add(l);
				
				_ident += _IDENT_INC;
				interfaceBlock(_t);
				_t = _retTree;
				
				_ident -= _IDENT_INC;   
				Line l2 = new Line("}", null, null, 1, _ident, _lines.size()); 
				_lines.add(l2);
				_t = __t13;
				_t = _t.getNextSibling();
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void objBlock(AST _t) throws RecognitionException {
		
		AST objBlock_AST_in = (AST)_t;
		
		try {      // for error handling
			AST __t38 = _t;
			AST tmp1_AST_in = (AST)_t;
			match(_t,OBJBLOCK);
			_t = _t.getFirstChild();
			{
			_loop40:
			do {
				if (_t==null) _t=ASTNULL;
				switch ( _t.getType()) {
				case CTOR_DEF:
				{
					ctorDef(_t);
					_t = _retTree;
					break;
				}
				case METHOD_DEF:
				{
					methodDef(_t);
					_t = _retTree;
					break;
				}
				case VARIABLE_DEF:
				{
					variableDef(_t);
					_t = _retTree;
					break;
				}
				case CLASS_DEF:
				case INTERFACE_DEF:
				{
					typeDefinition(_t);
					_t = _retTree;
					break;
				}
				default:
				{
					break _loop40;
				}
				}
			} while (true);
			}
			_t = __t38;
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void identifier(AST _t) throws RecognitionException {
		
		AST identifier_AST_in = (AST)_t;
		AST x = null;
		AST y = null;
		_currentID = new StringBuffer();
		
		try {      // for error handling
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case IDENT:
			{
				x = (AST)_t;
				match(_t,IDENT);
				_t = _t.getNextSibling();
				_currentID.append(x.getText());
				break;
			}
			case DOT:
			{
				AST __t70 = _t;
				AST tmp2_AST_in = (AST)_t;
				match(_t,DOT);
				_t = _t.getFirstChild();
				identifier(_t);
				_t = _retTree;
				y = (AST)_t;
				match(_t,IDENT);
				_t = _t.getNextSibling();
				_t = __t70;
				_t = _t.getNextSibling();
				_currentID.append("." + y.getText());
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void identifierStar(AST _t) throws RecognitionException {
		
		AST identifierStar_AST_in = (AST)_t;
		AST x = null;
		AST y = null;
		AST y2 = null;
		_currentID = new StringBuffer();
		
		try {      // for error handling
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case IDENT:
			{
				x = (AST)_t;
				match(_t,IDENT);
				_t = _t.getNextSibling();
				_currentID.append(x.getText());
				break;
			}
			case DOT:
			{
				AST __t72 = _t;
				AST tmp3_AST_in = (AST)_t;
				match(_t,DOT);
				_t = _t.getFirstChild();
				identifier(_t);
				_t = _retTree;
				{
				if (_t==null) _t=ASTNULL;
				switch ( _t.getType()) {
				case STAR:
				{
					y = (AST)_t;
					match(_t,STAR);
					_t = _t.getNextSibling();
					_currentID.append(".*");
					break;
				}
				case IDENT:
				{
					y2 = (AST)_t;
					match(_t,IDENT);
					_t = _t.getNextSibling();
					_currentID.append("." + y2.getText());
					break;
				}
				default:
				{
					throw new NoViableAltException(_t);
				}
				}
				}
				_t = __t72;
				_t = _t.getNextSibling();
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void modifiers(AST _t) throws RecognitionException {
		
		AST modifiers_AST_in = (AST)_t;
		AST n1 = null;
		_currentModifiers = new StringBuffer();
		
		try {      // for error handling
			AST __t21 = _t;
			AST tmp4_AST_in = (AST)_t;
			match(_t,MODIFIERS);
			_t = _t.getFirstChild();
			{
			_loop23:
			do {
				if (_t==null) _t=ASTNULL;
				if ((_tokenSet_0.member(_t.getType()))) {
					n1 = _t==ASTNULL ? null : (AST)_t;
					modifier(_t);
					_t = _retTree;
					_currentModifiers.append(n1.getText() + " ");
				}
				else {
					break _loop23;
				}
				
			} while (true);
			}
			_t = __t21;
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void extendsClause(AST _t) throws RecognitionException {
		
		AST extendsClause_AST_in = (AST)_t;
		_idList.clear();
		
		try {      // for error handling
			AST __t26 = _t;
			AST tmp5_AST_in = (AST)_t;
			match(_t,EXTENDS_CLAUSE);
			_t = _t.getFirstChild();
			{
			_loop28:
			do {
				if (_t==null) _t=ASTNULL;
				if ((_t.getType()==IDENT||_t.getType()==DOT)) {
					identifier(_t);
					_t = _retTree;
					_idList.add(_currentID.toString());
				}
				else {
					break _loop28;
				}
				
			} while (true);
			}
			_t = __t26;
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void implementsClause(AST _t) throws RecognitionException {
		
		AST implementsClause_AST_in = (AST)_t;
		_idList.clear();
		
		try {      // for error handling
			AST __t30 = _t;
			AST tmp6_AST_in = (AST)_t;
			match(_t,IMPLEMENTS_CLAUSE);
			_t = _t.getFirstChild();
			{
			_loop32:
			do {
				if (_t==null) _t=ASTNULL;
				if ((_t.getType()==IDENT||_t.getType()==DOT)) {
					identifier(_t);
					_t = _retTree;
					_idList.add(_currentID.toString());
				}
				else {
					break _loop32;
				}
				
			} while (true);
			}
			_t = __t30;
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void interfaceBlock(AST _t) throws RecognitionException {
		
		AST interfaceBlock_AST_in = (AST)_t;
		
		try {      // for error handling
			AST __t34 = _t;
			AST tmp7_AST_in = (AST)_t;
			match(_t,OBJBLOCK);
			_t = _t.getFirstChild();
			{
			_loop36:
			do {
				if (_t==null) _t=ASTNULL;
				switch ( _t.getType()) {
				case METHOD_DEF:
				{
					methodDecl(_t);
					_t = _retTree;
					break;
				}
				case VARIABLE_DEF:
				{
					variableDef(_t);
					_t = _retTree;
					break;
				}
				default:
				{
					break _loop36;
				}
				}
			} while (true);
			}
			_t = __t34;
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void typeSpec(AST _t) throws RecognitionException {
		
		AST typeSpec_AST_in = (AST)_t;
		_ntypeArray = 0;
		
		try {      // for error handling
			AST __t15 = _t;
			AST tmp8_AST_in = (AST)_t;
			match(_t,TYPE);
			_t = _t.getFirstChild();
			typeSpecArray(_t);
			_t = _retTree;
			_t = __t15;
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void typeSpecArray(AST _t) throws RecognitionException {
		
		AST typeSpecArray_AST_in = (AST)_t;
		
		try {      // for error handling
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case ARRAY_DECLARATOR:
			{
				AST __t17 = _t;
				AST tmp9_AST_in = (AST)_t;
				match(_t,ARRAY_DECLARATOR);
				_t = _t.getFirstChild();
				_ntypeArray++;
				typeSpecArray(_t);
				_t = _retTree;
				_t = __t17;
				_t = _t.getNextSibling();
				break;
			}
			case LITERAL_void:
			case LITERAL_boolean:
			case LITERAL_byte:
			case LITERAL_char:
			case LITERAL_short:
			case LITERAL_int:
			case LITERAL_float:
			case LITERAL_long:
			case LITERAL_double:
			case IDENT:
			case DOT:
			{
				type(_t);
				_t = _retTree;
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void type(AST _t) throws RecognitionException {
		
		AST type_AST_in = (AST)_t;
		AST n1 = null;
		
		try {      // for error handling
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case IDENT:
			case DOT:
			{
				identifier(_t);
				_t = _retTree;
				_typeName = _currentID.toString();
				break;
			}
			case LITERAL_void:
			case LITERAL_boolean:
			case LITERAL_byte:
			case LITERAL_char:
			case LITERAL_short:
			case LITERAL_int:
			case LITERAL_float:
			case LITERAL_long:
			case LITERAL_double:
			{
				n1 = _t==ASTNULL ? null : (AST)_t;
				builtInType(_t);
				_t = _retTree;
				_typeName = n1.getText();
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void builtInType(AST _t) throws RecognitionException {
		
		AST builtInType_AST_in = (AST)_t;
		
		try {      // for error handling
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case LITERAL_void:
			{
				AST tmp10_AST_in = (AST)_t;
				match(_t,LITERAL_void);
				_t = _t.getNextSibling();
				break;
			}
			case LITERAL_boolean:
			{
				AST tmp11_AST_in = (AST)_t;
				match(_t,LITERAL_boolean);
				_t = _t.getNextSibling();
				break;
			}
			case LITERAL_byte:
			{
				AST tmp12_AST_in = (AST)_t;
				match(_t,LITERAL_byte);
				_t = _t.getNextSibling();
				break;
			}
			case LITERAL_char:
			{
				AST tmp13_AST_in = (AST)_t;
				match(_t,LITERAL_char);
				_t = _t.getNextSibling();
				break;
			}
			case LITERAL_short:
			{
				AST tmp14_AST_in = (AST)_t;
				match(_t,LITERAL_short);
				_t = _t.getNextSibling();
				break;
			}
			case LITERAL_int:
			{
				AST tmp15_AST_in = (AST)_t;
				match(_t,LITERAL_int);
				_t = _t.getNextSibling();
				break;
			}
			case LITERAL_float:
			{
				AST tmp16_AST_in = (AST)_t;
				match(_t,LITERAL_float);
				_t = _t.getNextSibling();
				break;
			}
			case LITERAL_long:
			{
				AST tmp17_AST_in = (AST)_t;
				match(_t,LITERAL_long);
				_t = _t.getNextSibling();
				break;
			}
			case LITERAL_double:
			{
				AST tmp18_AST_in = (AST)_t;
				match(_t,LITERAL_double);
				_t = _t.getNextSibling();
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void modifier(AST _t) throws RecognitionException {
		
		AST modifier_AST_in = (AST)_t;
		
		try {      // for error handling
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case LITERAL_private:
			{
				AST tmp19_AST_in = (AST)_t;
				match(_t,LITERAL_private);
				_t = _t.getNextSibling();
				break;
			}
			case LITERAL_public:
			{
				AST tmp20_AST_in = (AST)_t;
				match(_t,LITERAL_public);
				_t = _t.getNextSibling();
				break;
			}
			case LITERAL_protected:
			{
				AST tmp21_AST_in = (AST)_t;
				match(_t,LITERAL_protected);
				_t = _t.getNextSibling();
				break;
			}
			case LITERAL_static:
			{
				AST tmp22_AST_in = (AST)_t;
				match(_t,LITERAL_static);
				_t = _t.getNextSibling();
				break;
			}
			case LITERAL_transient:
			{
				AST tmp23_AST_in = (AST)_t;
				match(_t,LITERAL_transient);
				_t = _t.getNextSibling();
				break;
			}
			case FINAL:
			{
				AST tmp24_AST_in = (AST)_t;
				match(_t,FINAL);
				_t = _t.getNextSibling();
				break;
			}
			case ABSTRACT:
			{
				AST tmp25_AST_in = (AST)_t;
				match(_t,ABSTRACT);
				_t = _t.getNextSibling();
				break;
			}
			case LITERAL_native:
			{
				AST tmp26_AST_in = (AST)_t;
				match(_t,LITERAL_native);
				_t = _t.getNextSibling();
				break;
			}
			case LITERAL_threadsafe:
			{
				AST tmp27_AST_in = (AST)_t;
				match(_t,LITERAL_threadsafe);
				_t = _t.getNextSibling();
				break;
			}
			case LITERAL_synchronized:
			{
				AST tmp28_AST_in = (AST)_t;
				match(_t,LITERAL_synchronized);
				_t = _t.getNextSibling();
				break;
			}
			case LITERAL_const:
			{
				AST tmp29_AST_in = (AST)_t;
				match(_t,LITERAL_const);
				_t = _t.getNextSibling();
				break;
			}
			case LITERAL_volatile:
			{
				AST tmp30_AST_in = (AST)_t;
				match(_t,LITERAL_volatile);
				_t = _t.getNextSibling();
				break;
			}
			case STRICTFP:
			{
				AST tmp31_AST_in = (AST)_t;
				match(_t,STRICTFP);
				_t = _t.getNextSibling();
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void methodDecl(AST _t) throws RecognitionException {
		
		AST methodDecl_AST_in = (AST)_t;
		AST n1 = null;
		
		try {      // for error handling
			AST __t44 = _t;
			n1 = _t==ASTNULL ? null :(AST)_t;
			match(_t,METHOD_DEF);
			_t = _t.getFirstChild();
			StringBuffer line = new StringBuffer();
			modifiers(_t);
			_t = _retTree;
			line.append(_currentModifiers.toString() + " ");
			typeSpec(_t);
			_t = _retTree;
			
					          line.append(_typeName + " ");
						  for(int i = 0;i < _ntypeArray;i++) {
						      line.append("[]");
						  }
						  line.append(" ");
					
			methodHead(_t);
			_t = _retTree;
			
					           line.append(_methodHead.toString());
					           line.append(";");
					           Line l = new Line(line.toString(), n1, null, 1, _ident, _lines.size()); 
						   _lines.add(l);
				
			_t = __t44;
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void variableDef(AST _t) throws RecognitionException {
		
		AST variableDef_AST_in = (AST)_t;
		AST n1 = null;
		StringBuffer line = new StringBuffer();
		
		try {      // for error handling
			AST __t49 = _t;
			n1 = _t==ASTNULL ? null :(AST)_t;
			match(_t,VARIABLE_DEF);
			_t = _t.getFirstChild();
			modifiers(_t);
			_t = _retTree;
			line.append(_currentModifiers.toString());
			typeSpec(_t);
			_t = _retTree;
			
			line.append(_typeName + " ");
			for(int i = 0;i < _ntypeArray;i++) {
			line.append("[]");
			}
			line.append(" ");
			
			variableDeclarator(_t);
			_t = _retTree;
			
			line.append(_currentID.toString() + " ");
			
			varInitializer(_t);
			_t = _retTree;
			
			if(_varInitializer != null) {				          
			line.append(_varInitializer);
			_varInitializer = null;
			}
			
			line.append(";"); 
			Line l = new Line(line.toString(), n1, null, 1, _ident, _lines.size()); 
			_lines.add(l);
			_t = __t49;
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void ctorDef(AST _t) throws RecognitionException {
		
		AST ctorDef_AST_in = (AST)_t;
		AST n1 = null;
		
		try {      // for error handling
			AST __t42 = _t;
			n1 = _t==ASTNULL ? null :(AST)_t;
			match(_t,CTOR_DEF);
			_t = _t.getFirstChild();
			StringBuffer line = new StringBuffer();
			modifiers(_t);
			_t = _retTree;
			line.append(_currentModifiers.toString() + " ");
			methodHead(_t);
			_t = _retTree;
			
					           line.append(_methodHead.toString()); 
					           line.append(" {"); 
					           Line l = new Line(line.toString(), n1, null, 1, _ident, _lines.size()); 
						   _lines.add(l);
				
			ctorSList(_t);
			_t = _retTree;
			
					          Iterator ite = _currentCInfo.constructorsIterator();
						  while(ite.hasNext()) {
						      STMethodEntry me = (STMethodEntry) ite.next();
						      AST node = me.getNode();
						      if(node.equalsTree(n1)) {
					                  FlowGraph fg = me.getFlowGraph();
						          fg.generateCode(_lines, _ident + _IDENT_INC);
							  break;
						      }
						  }
					
			l = new Line("}", null, null, 2, _ident, _lines.size());
					        _lines.add(l);
			_t = __t42;
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void methodDef(AST _t) throws RecognitionException {
		
		AST methodDef_AST_in = (AST)_t;
		AST n1 = null;
		
		try {      // for error handling
			AST __t46 = _t;
			n1 = _t==ASTNULL ? null :(AST)_t;
			match(_t,METHOD_DEF);
			_t = _t.getFirstChild();
			StringBuffer line = new StringBuffer();
			modifiers(_t);
			_t = _retTree;
			line.append(_currentModifiers.toString() + " ");
			typeSpec(_t);
			_t = _retTree;
			
					          line.append(_typeName + " ");
						  for(int i = 0;i < _ntypeArray;i++) {
						      line.append("[]");
						  }
						  line.append(" ");
					
			methodHead(_t);
			_t = _retTree;
			
					           line.append(_methodHead.toString()); 
					           line.append(" {"); 
					           Line l = new Line(line.toString(), n1, null, 1, _ident, _lines.size()); 
						   _lines.add(l);
				
			{
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case SLIST:
			{
				slist(_t);
				_t = _retTree;
				break;
			}
			case 3:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
			}
			
						  LinkedList ml = (LinkedList) _currentCInfo.getMethod(_methodName);
			if(ml != null) {
			for(int i = 0;i < ml.size();i++) {
			STMethodEntry me = (STMethodEntry) ml.get(i);
			if( n1.equalsTree(me.getNode()) ) {
			FlowGraph fg = me.getFlowGraph();
			fg.generateCode(_lines, _ident + _IDENT_INC);
			l = new Line("}", null, null, 2, _ident, _lines.size()); 
			_lines.add(l);
			break;
			}
			}
			}
			else {
			l = new Line("Not processed", null, null, 2, 
			_ident, _lines.size());
			l = new Line("}", null, null, 2, _ident, _lines.size());
			}
					
			_t = __t46;
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void methodHead(AST _t) throws RecognitionException {
		
		AST methodHead_AST_in = (AST)_t;
		AST n1 = null;
		_methodHead = new StringBuffer(); _parList.clear(); _idList.clear();
		
		try {      // for error handling
			n1 = (AST)_t;
			match(_t,IDENT);
			_t = _t.getNextSibling();
			_methodHead.append(n1.getText() + "("); _methodName = n1.getText();
			AST __t61 = _t;
			AST tmp32_AST_in = (AST)_t;
			match(_t,PARAMETERS);
			_t = _t.getFirstChild();
			{
			_loop63:
			do {
				if (_t==null) _t=ASTNULL;
				if ((_t.getType()==PARAMETER_DEF)) {
					parameterDef(_t);
					_t = _retTree;
					_parList.add(_currentPar.toString());
				}
				else {
					break _loop63;
				}
				
			} while (true);
			}
			_t = __t61;
			_t = _t.getNextSibling();
			
					    if(_parList.size() > 0) {
			for(int i = 0;i < _parList.size() - 1;i++) {
						    String s = (String) _parList.get(i);
			_methodHead.append(s + ", ");
						}
						String s = (String) _parList.get(_parList.size() - 1);
						_methodHead.append(s);
					    }
					    _methodHead.append(")");
					
					
			{
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case LITERAL_throws:
			{
				throwsClause(_t);
				_t = _retTree;
				break;
			}
			case 3:
			case SLIST:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
			}
			
					    if(_idList.size() > 0) {
					        _methodHead.append(" throws ");
					        for(int i = 0;i < _idList.size() - 1;i++) {
						    String s = (String) _idList.get(i);
						    _methodHead.append(s + ", ");
						}			
						_methodHead.append((String) _idList.get(_idList.size() - 1));		    		    
			_idList.clear();
					    }
					
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void ctorSList(AST _t) throws RecognitionException {
		
		AST ctorSList_AST_in = (AST)_t;
		
		try {      // for error handling
			AST tmp33_AST_in = (AST)_t;
			match(_t,SLIST);
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void slist(AST _t) throws RecognitionException {
		
		AST slist_AST_in = (AST)_t;
		
		try {      // for error handling
			AST tmp34_AST_in = (AST)_t;
			match(_t,SLIST);
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void variableDeclarator(AST _t) throws RecognitionException {
		
		AST variableDeclarator_AST_in = (AST)_t;
		AST n1 = null;
		_currentID = new StringBuffer();
		
		try {      // for error handling
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case IDENT:
			{
				n1 = (AST)_t;
				match(_t,IDENT);
				_t = _t.getNextSibling();
				_currentID.append(n1.getText());
				break;
			}
			case LBRACK:
			{
				AST tmp35_AST_in = (AST)_t;
				match(_t,LBRACK);
				_t = _t.getNextSibling();
				variableDeclarator(_t);
				_t = _retTree;
				System.out.println("UMA SITUACAO NAO PROCESSADA : LBRACK variableDeclarator");
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void varInitializer(AST _t) throws RecognitionException {
		
		AST varInitializer_AST_in = (AST)_t;
		_initializer = new StringBuffer();
		
		try {      // for error handling
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case ASSIGN:
			{
				AST __t54 = _t;
				AST tmp36_AST_in = (AST)_t;
				match(_t,ASSIGN);
				_t = _t.getFirstChild();
				initializer(_t);
				_t = _retTree;
				_t = __t54;
				_t = _t.getNextSibling();
				_varInitializer = new String("= " + _initializer.toString());
				break;
			}
			case 3:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void parameterDef(AST _t) throws RecognitionException {
		
		AST parameterDef_AST_in = (AST)_t;
		AST n1 = null;
		_currentPar = new StringBuffer();
		
		try {      // for error handling
			AST __t51 = _t;
			AST tmp37_AST_in = (AST)_t;
			match(_t,PARAMETER_DEF);
			_t = _t.getFirstChild();
			modifiers(_t);
			_t = _retTree;
			_currentPar.append(_currentModifiers.toString());
			typeSpec(_t);
			_t = _retTree;
			
					        _currentPar.append(_typeName + " ");
					        for(int i = 0;i < _ntypeArray;i++) {
						    _currentPar.append("[]");
						}
						_currentPar.append(" ");
					
			n1 = (AST)_t;
			match(_t,IDENT);
			_t = _t.getNextSibling();
			_currentPar.append(n1.getText());
			_t = __t51;
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void initializer(AST _t) throws RecognitionException {
		
		AST initializer_AST_in = (AST)_t;
		_currentEXPR = new StringBuffer();
		
		try {      // for error handling
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case EXPR:
			{
				expression(_t);
				_t = _retTree;
				_initializer.append(_currentEXPR.toString());
				break;
			}
			case ARRAY_INIT:
			{
				arrayInitializer(_t);
				_t = _retTree;
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void expression(AST _t) throws RecognitionException {
		
		AST expression_AST_in = (AST)_t;
		
		try {      // for error handling
			AST __t81 = _t;
			AST tmp38_AST_in = (AST)_t;
			match(_t,EXPR);
			_t = _t.getFirstChild();
			expr(_t);
			_t = _retTree;
			_t = __t81;
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void arrayInitializer(AST _t) throws RecognitionException {
		
		AST arrayInitializer_AST_in = (AST)_t;
		
		try {      // for error handling
			AST __t57 = _t;
			AST tmp39_AST_in = (AST)_t;
			match(_t,ARRAY_INIT);
			_t = _t.getFirstChild();
			_initializer.append("{");
			initializer(_t);
			_t = _retTree;
			{
			_loop59:
			do {
				if (_t==null) _t=ASTNULL;
				if ((_t.getType()==EXPR||_t.getType()==ARRAY_INIT)) {
					_initializer.append(",");
					initializer(_t);
					_t = _retTree;
				}
				else {
					break _loop59;
				}
				
			} while (true);
			}
			_initializer.append("}");
			_t = __t57;
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void throwsClause(AST _t) throws RecognitionException {
		
		AST throwsClause_AST_in = (AST)_t;
		_idList.clear();
		
		try {      // for error handling
			AST __t66 = _t;
			AST tmp40_AST_in = (AST)_t;
			match(_t,LITERAL_throws);
			_t = _t.getFirstChild();
			{
			_loop68:
			do {
				if (_t==null) _t=ASTNULL;
				if ((_t.getType()==IDENT||_t.getType()==DOT)) {
					identifier(_t);
					_t = _retTree;
					_idList.add(_currentID.toString());
				}
				else {
					break _loop68;
				}
				
			} while (true);
			}
			_t = __t66;
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void elist(AST _t) throws RecognitionException {
		
		AST elist_AST_in = (AST)_t;
		_exprStack.push(_exprList); _exprList = new LinkedList();
		
		try {      // for error handling
			AST __t77 = _t;
			AST tmp41_AST_in = (AST)_t;
			match(_t,ELIST);
			_t = _t.getFirstChild();
			{
			_loop79:
			do {
				if (_t==null) _t=ASTNULL;
				if ((_t.getType()==EXPR)) {
					expression(_t);
					_t = _retTree;
					_exprList.add(_currentEXPR.toString());
				}
				else {
					break _loop79;
				}
				
			} while (true);
			}
			_t = __t77;
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void expr(AST _t) throws RecognitionException {
		
		AST expr_AST_in = (AST)_t;
		
		try {      // for error handling
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case QUESTION:
			{
				AST __t83 = _t;
				AST tmp42_AST_in = (AST)_t;
				match(_t,QUESTION);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp3 = _currentEXPR.toString(); 
							       _currentEXPR = new StringBuffer("(" + _exp1 + ")?" + _exp2 + ":" + _exp3); 
							
				_t = __t83;
				_t = _t.getNextSibling();
				break;
			}
			case ASSIGN:
			{
				AST __t84 = _t;
				AST tmp43_AST_in = (AST)_t;
				match(_t,ASSIGN);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString();
				_currentEXPR = new StringBuffer(_exp1 + " = " + _exp2); 
							
				_t = __t84;
				_t = _t.getNextSibling();
				break;
			}
			case PLUS_ASSIGN:
			{
				AST __t85 = _t;
				AST tmp44_AST_in = (AST)_t;
				match(_t,PLUS_ASSIGN);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer(_exp1 + " += " + _exp2);
							
				_t = __t85;
				_t = _t.getNextSibling();
				break;
			}
			case MINUS_ASSIGN:
			{
				AST __t86 = _t;
				AST tmp45_AST_in = (AST)_t;
				match(_t,MINUS_ASSIGN);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString();
							          _currentEXPR = new StringBuffer(_exp1 + " -= " + _exp2);
						 	
				_t = __t86;
				_t = _t.getNextSibling();
				break;
			}
			case STAR_ASSIGN:
			{
				AST __t87 = _t;
				AST tmp46_AST_in = (AST)_t;
				match(_t,STAR_ASSIGN);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer(_exp1 + " *= " + _exp2);
							
				_t = __t87;
				_t = _t.getNextSibling();
				break;
			}
			case DIV_ASSIGN:
			{
				AST __t88 = _t;
				AST tmp47_AST_in = (AST)_t;
				match(_t,DIV_ASSIGN);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer(_exp1 + " /= " + _exp2);
							
				_t = __t88;
				_t = _t.getNextSibling();
				break;
			}
			case MOD_ASSIGN:
			{
				AST __t89 = _t;
				AST tmp48_AST_in = (AST)_t;
				match(_t,MOD_ASSIGN);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString();
							          _currentEXPR = new StringBuffer(_exp1 + " %= " + _exp2);
							
				_t = __t89;
				_t = _t.getNextSibling();
				break;
			}
			case SR_ASSIGN:
			{
				AST __t90 = _t;
				AST tmp49_AST_in = (AST)_t;
				match(_t,SR_ASSIGN);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString();
							          _currentEXPR = new StringBuffer(_exp1 + " >>= " + _exp2);
							
				_t = __t90;
				_t = _t.getNextSibling();
				break;
			}
			case BSR_ASSIGN:
			{
				AST __t91 = _t;
				AST tmp50_AST_in = (AST)_t;
				match(_t,BSR_ASSIGN);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer(_exp1 + " >>>= " + _exp2);
							
				_t = __t91;
				_t = _t.getNextSibling();
				break;
			}
			case SL_ASSIGN:
			{
				AST __t92 = _t;
				AST tmp51_AST_in = (AST)_t;
				match(_t,SL_ASSIGN);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer(_exp1 + " <<= " + _exp2);
							
				_t = __t92;
				_t = _t.getNextSibling();
				break;
			}
			case BAND_ASSIGN:
			{
				AST __t93 = _t;
				AST tmp52_AST_in = (AST)_t;
				match(_t,BAND_ASSIGN);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer(_exp1 + " &= " + _exp2);
							
				_t = __t93;
				_t = _t.getNextSibling();
				break;
			}
			case BXOR_ASSIGN:
			{
				AST __t94 = _t;
				AST tmp53_AST_in = (AST)_t;
				match(_t,BXOR_ASSIGN);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer(_exp1 + " ^= " + _exp2);
							
				_t = __t94;
				_t = _t.getNextSibling();
				break;
			}
			case BOR_ASSIGN:
			{
				AST __t95 = _t;
				AST tmp54_AST_in = (AST)_t;
				match(_t,BOR_ASSIGN);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer(_exp1 + " |= " + _exp2);
							
				_t = __t95;
				_t = _t.getNextSibling();
				break;
			}
			case LOR:
			{
				AST __t96 = _t;
				AST tmp55_AST_in = (AST)_t;
				match(_t,LOR);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer("(" + _exp1 + " || " + _exp2 + ")");
							
				_t = __t96;
				_t = _t.getNextSibling();
				break;
			}
			case LAND:
			{
				AST __t97 = _t;
				AST tmp56_AST_in = (AST)_t;
				match(_t,LAND);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer("(" + _exp1 + " && " + _exp2 + ")");
							
				_t = __t97;
				_t = _t.getNextSibling();
				break;
			}
			case BOR:
			{
				AST __t98 = _t;
				AST tmp57_AST_in = (AST)_t;
				match(_t,BOR);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer("(" + _exp1 + " | " + _exp2 + ")");
							
				_t = __t98;
				_t = _t.getNextSibling();
				break;
			}
			case BXOR:
			{
				AST __t99 = _t;
				AST tmp58_AST_in = (AST)_t;
				match(_t,BXOR);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer("(" + _exp1 + " ^ " + _exp2 + ")");
							
				_t = __t99;
				_t = _t.getNextSibling();
				break;
			}
			case BAND:
			{
				AST __t100 = _t;
				AST tmp59_AST_in = (AST)_t;
				match(_t,BAND);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer("(" + _exp1 + " & " + _exp2 + ")");
							
				_t = __t100;
				_t = _t.getNextSibling();
				break;
			}
			case NOT_EQUAL:
			{
				AST __t101 = _t;
				AST tmp60_AST_in = (AST)_t;
				match(_t,NOT_EQUAL);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer("(" + _exp1 + " != " + _exp2 + ")");
							
				_t = __t101;
				_t = _t.getNextSibling();
				break;
			}
			case EQUAL:
			{
				AST __t102 = _t;
				AST tmp61_AST_in = (AST)_t;
				match(_t,EQUAL);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer("(" + _exp1 + " == " + _exp2 + ")");
							
				_t = __t102;
				_t = _t.getNextSibling();
				break;
			}
			case LT:
			{
				AST __t103 = _t;
				AST tmp62_AST_in = (AST)_t;
				match(_t,LT);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer("(" + _exp1 + " < " + _exp2 + ")");
							
				_t = __t103;
				_t = _t.getNextSibling();
				break;
			}
			case GT:
			{
				AST __t104 = _t;
				AST tmp63_AST_in = (AST)_t;
				match(_t,GT);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer("(" + _exp1 + " > " + _exp2 + ")");
							
				_t = __t104;
				_t = _t.getNextSibling();
				break;
			}
			case LE:
			{
				AST __t105 = _t;
				AST tmp64_AST_in = (AST)_t;
				match(_t,LE);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer("(" + _exp1 + " <= " + _exp2 + ")");
							
				_t = __t105;
				_t = _t.getNextSibling();
				break;
			}
			case GE:
			{
				AST __t106 = _t;
				AST tmp65_AST_in = (AST)_t;
				match(_t,GE);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer("(" + _exp1 + " >= " + _exp2 + ")");
							
				_t = __t106;
				_t = _t.getNextSibling();
				break;
			}
			case SL:
			{
				AST __t107 = _t;
				AST tmp66_AST_in = (AST)_t;
				match(_t,SL);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer("(" + _exp1 + " << " + _exp2 + ")");
							
				_t = __t107;
				_t = _t.getNextSibling();
				break;
			}
			case SR:
			{
				AST __t108 = _t;
				AST tmp67_AST_in = (AST)_t;
				match(_t,SR);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer("(" + _exp1 + " >> " + _exp2 + ")");
							
				_t = __t108;
				_t = _t.getNextSibling();
				break;
			}
			case BSR:
			{
				AST __t109 = _t;
				AST tmp68_AST_in = (AST)_t;
				match(_t,BSR);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer("(" + _exp1 + " >>> " + _exp2 + ")");
							
				_t = __t109;
				_t = _t.getNextSibling();
				break;
			}
			case PLUS:
			{
				AST __t110 = _t;
				AST tmp69_AST_in = (AST)_t;
				match(_t,PLUS);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer("(" + _exp1 + " + " + _exp2 + ")");
							
				_t = __t110;
				_t = _t.getNextSibling();
				break;
			}
			case MINUS:
			{
				AST __t111 = _t;
				AST tmp70_AST_in = (AST)_t;
				match(_t,MINUS);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer("(" + _exp1 + " - " + _exp2 + ")");
							
				_t = __t111;
				_t = _t.getNextSibling();
				break;
			}
			case DIV:
			{
				AST __t112 = _t;
				AST tmp71_AST_in = (AST)_t;
				match(_t,DIV);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer("(" + _exp1 + " / " + _exp2 + ")");
							
				_t = __t112;
				_t = _t.getNextSibling();
				break;
			}
			case MOD:
			{
				AST __t113 = _t;
				AST tmp72_AST_in = (AST)_t;
				match(_t,MOD);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer("(" + _exp1 + " % " + _exp2 + ")");
							
				_t = __t113;
				_t = _t.getNextSibling();
				break;
			}
			case STAR:
			{
				AST __t114 = _t;
				AST tmp73_AST_in = (AST)_t;
				match(_t,STAR);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer("(" + _exp1 + " * " + _exp2 + ")");
							
				_t = __t114;
				_t = _t.getNextSibling();
				break;
			}
			case INC:
			{
				AST __t115 = _t;
				AST tmp74_AST_in = (AST)_t;
				match(_t,INC);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString(); 
					                     _currentEXPR = new StringBuffer("++" + _exp1); 
							
				_t = __t115;
				_t = _t.getNextSibling();
				break;
			}
			case DEC:
			{
				AST __t116 = _t;
				AST tmp75_AST_in = (AST)_t;
				match(_t,DEC);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString(); 
					                     _currentEXPR = new StringBuffer("--" + _exp1);
				_t = __t116;
				_t = _t.getNextSibling();
				break;
			}
			case POST_INC:
			{
				AST __t117 = _t;
				AST tmp76_AST_in = (AST)_t;
				match(_t,POST_INC);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString(); 
					                          _currentEXPR = new StringBuffer(_exp1 + "++");
				_t = __t117;
				_t = _t.getNextSibling();
				break;
			}
			case POST_DEC:
			{
				AST __t118 = _t;
				AST tmp77_AST_in = (AST)_t;
				match(_t,POST_DEC);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString(); 
					                          _currentEXPR = new StringBuffer(_exp1 + "--");
				_t = __t118;
				_t = _t.getNextSibling();
				break;
			}
			case BNOT:
			{
				AST __t119 = _t;
				AST tmp78_AST_in = (AST)_t;
				match(_t,BNOT);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString(); 
					                      _currentEXPR = new StringBuffer("(~" + _exp1 + ")");
				_t = __t119;
				_t = _t.getNextSibling();
				break;
			}
			case LNOT:
			{
				AST __t120 = _t;
				AST tmp79_AST_in = (AST)_t;
				match(_t,LNOT);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString(); 
					                      _currentEXPR = new StringBuffer("(!" + _exp1 + ")");
				_t = __t120;
				_t = _t.getNextSibling();
				break;
			}
			case LITERAL_instanceof:
			{
				AST __t121 = _t;
				AST tmp80_AST_in = (AST)_t;
				match(_t,LITERAL_instanceof);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString();
				expr(_t);
				_t = _retTree;
				String _exp2 = _currentEXPR.toString(); 
							          _currentEXPR = new StringBuffer("(" + _exp1 + " instanceof " + _exp2 + ")");
							
				_t = __t121;
				_t = _t.getNextSibling();
				break;
			}
			case UNARY_MINUS:
			{
				AST __t122 = _t;
				AST tmp81_AST_in = (AST)_t;
				match(_t,UNARY_MINUS);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString(); 
					                             _currentEXPR = new StringBuffer("-" + _exp1);
				_t = __t122;
				_t = _t.getNextSibling();
				break;
			}
			case UNARY_PLUS:
			{
				AST __t123 = _t;
				AST tmp82_AST_in = (AST)_t;
				match(_t,UNARY_PLUS);
				_t = _t.getFirstChild();
				expr(_t);
				_t = _retTree;
				String _exp1 = _currentEXPR.toString(); 
					                            _currentEXPR = new StringBuffer("+" + _exp1);
				_t = __t123;
				_t = _t.getNextSibling();
				break;
			}
			case TYPE:
			case TYPECAST:
			case INDEX_OP:
			case METHOD_CALL:
			case IDENT:
			case DOT:
			case LITERAL_this:
			case LITERAL_super:
			case LITERAL_true:
			case LITERAL_false:
			case LITERAL_null:
			case LITERAL_new:
			case NUM_INT:
			case CHAR_LITERAL:
			case STRING_LITERAL:
			case NUM_FLOAT:
			case NUM_LONG:
			case NUM_DOUBLE:
			{
				primaryExpression(_t);
				_t = _retTree;
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void primaryExpression(AST _t) throws RecognitionException {
		
		AST primaryExpression_AST_in = (AST)_t;
		AST n1 = null;
		AST n2 = null;
		
		try {      // for error handling
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case IDENT:
			{
				n1 = (AST)_t;
				match(_t,IDENT);
				_t = _t.getNextSibling();
				_currentEXPR = new StringBuffer(n1.getText());
				break;
			}
			case DOT:
			{
				AST __t125 = _t;
				AST tmp83_AST_in = (AST)_t;
				match(_t,DOT);
				_t = _t.getFirstChild();
				String dot;
				{
				if (_t==null) _t=ASTNULL;
				switch ( _t.getType()) {
				case TYPE:
				case TYPECAST:
				case INDEX_OP:
				case POST_INC:
				case POST_DEC:
				case METHOD_CALL:
				case UNARY_MINUS:
				case UNARY_PLUS:
				case IDENT:
				case DOT:
				case STAR:
				case LITERAL_this:
				case LITERAL_super:
				case ASSIGN:
				case PLUS_ASSIGN:
				case MINUS_ASSIGN:
				case STAR_ASSIGN:
				case DIV_ASSIGN:
				case MOD_ASSIGN:
				case SR_ASSIGN:
				case BSR_ASSIGN:
				case SL_ASSIGN:
				case BAND_ASSIGN:
				case BXOR_ASSIGN:
				case BOR_ASSIGN:
				case QUESTION:
				case LOR:
				case LAND:
				case BOR:
				case BXOR:
				case BAND:
				case NOT_EQUAL:
				case EQUAL:
				case LT:
				case GT:
				case LE:
				case GE:
				case LITERAL_instanceof:
				case SL:
				case SR:
				case BSR:
				case PLUS:
				case MINUS:
				case DIV:
				case MOD:
				case INC:
				case DEC:
				case BNOT:
				case LNOT:
				case LITERAL_true:
				case LITERAL_false:
				case LITERAL_null:
				case LITERAL_new:
				case NUM_INT:
				case CHAR_LITERAL:
				case STRING_LITERAL:
				case NUM_FLOAT:
				case NUM_LONG:
				case NUM_DOUBLE:
				{
					expr(_t);
					_t = _retTree;
					dot = _currentEXPR.toString();
					{
					if (_t==null) _t=ASTNULL;
					switch ( _t.getType()) {
					case IDENT:
					{
						n2 = (AST)_t;
						match(_t,IDENT);
						_t = _t.getNextSibling();
						_currentEXPR = new StringBuffer(dot + "." + n2.getText());
						break;
					}
					case INDEX_OP:
					{
						arrayIndex(_t);
						_t = _retTree;
						break;
					}
					case LITERAL_this:
					{
						AST tmp84_AST_in = (AST)_t;
						match(_t,LITERAL_this);
						_t = _t.getNextSibling();
						break;
					}
					case LITERAL_class:
					{
						AST tmp85_AST_in = (AST)_t;
						match(_t,LITERAL_class);
						_t = _t.getNextSibling();
						_currentEXPR = new StringBuffer(dot + ".class");
						break;
					}
					case LITERAL_new:
					{
						AST __t128 = _t;
						AST tmp86_AST_in = (AST)_t;
						match(_t,LITERAL_new);
						_t = _t.getFirstChild();
						AST tmp87_AST_in = (AST)_t;
						match(_t,IDENT);
						_t = _t.getNextSibling();
						elist(_t);
						_t = _retTree;
						_t = __t128;
						_t = _t.getNextSibling();
						break;
					}
					case LITERAL_super:
					{
						AST tmp88_AST_in = (AST)_t;
						match(_t,LITERAL_super);
						_t = _t.getNextSibling();
						break;
					}
					default:
					{
						throw new NoViableAltException(_t);
					}
					}
					}
					break;
				}
				case ARRAY_DECLARATOR:
				{
					AST __t129 = _t;
					AST tmp89_AST_in = (AST)_t;
					match(_t,ARRAY_DECLARATOR);
					_t = _t.getFirstChild();
					typeSpecArray(_t);
					_t = _retTree;
					_t = __t129;
					_t = _t.getNextSibling();
					break;
				}
				case LITERAL_void:
				case LITERAL_boolean:
				case LITERAL_byte:
				case LITERAL_char:
				case LITERAL_short:
				case LITERAL_int:
				case LITERAL_float:
				case LITERAL_long:
				case LITERAL_double:
				{
					builtInType(_t);
					_t = _retTree;
					{
					if (_t==null) _t=ASTNULL;
					switch ( _t.getType()) {
					case LITERAL_class:
					{
						AST tmp90_AST_in = (AST)_t;
						match(_t,LITERAL_class);
						_t = _t.getNextSibling();
						break;
					}
					case 3:
					{
						break;
					}
					default:
					{
						throw new NoViableAltException(_t);
					}
					}
					}
					break;
				}
				default:
				{
					throw new NoViableAltException(_t);
				}
				}
				}
				_t = __t125;
				_t = _t.getNextSibling();
				break;
			}
			case INDEX_OP:
			{
				arrayIndex(_t);
				_t = _retTree;
				_currentEXPR = new StringBuffer(_arrayIndexing.toString());
				break;
			}
			case METHOD_CALL:
			{
				AST __t131 = _t;
				AST tmp91_AST_in = (AST)_t;
				match(_t,METHOD_CALL);
				_t = _t.getFirstChild();
				StringBuffer ret = new StringBuffer();
				primaryExpression(_t);
				_t = _retTree;
				ret.append(_currentEXPR.toString() + "(");
				elist(_t);
				_t = _retTree;
				
						         if(_exprList.size() > 0) {
						             for(int i = 0;i < _exprList.size() - 1;i++) {
							         ret.append((String) _exprList.get(i) + ",");
							     }
							     ret.append((String) _exprList.get(_exprList.size() - 1));
							 }
							 ret.append(")");
							 _currentEXPR = new StringBuffer(ret.toString());
							 
							 _exprList = (LinkedList) _exprStack.pop();
						
				_t = __t131;
				_t = _t.getNextSibling();
				break;
			}
			case TYPECAST:
			{
				AST __t132 = _t;
				AST tmp92_AST_in = (AST)_t;
				match(_t,TYPECAST);
				_t = _t.getFirstChild();
				StringBuffer ret = new StringBuffer("((");
				typeSpec(_t);
				_t = _retTree;
				
						         ret.append(_typeName + " ");
						         for(int i = 0;i < _ntypeArray;i++) {
						             ret.append("[]");
						         }
							 ret.append(")");
						
				expr(_t);
				_t = _retTree;
				ret.append(_currentEXPR.toString() + ")"); 
						         _currentEXPR = new StringBuffer(ret.toString()); 
					
				_t = __t132;
				_t = _t.getNextSibling();
				break;
			}
			case LITERAL_new:
			{
				newExpression(_t);
				_t = _retTree;
				break;
			}
			case NUM_INT:
			case CHAR_LITERAL:
			case STRING_LITERAL:
			case NUM_FLOAT:
			case NUM_LONG:
			case NUM_DOUBLE:
			{
				constant(_t);
				_t = _retTree;
				_currentEXPR = new StringBuffer(_currentConst);
				break;
			}
			case LITERAL_super:
			{
				AST tmp93_AST_in = (AST)_t;
				match(_t,LITERAL_super);
				_t = _t.getNextSibling();
				_currentEXPR = new StringBuffer("super");
				break;
			}
			case LITERAL_true:
			{
				AST tmp94_AST_in = (AST)_t;
				match(_t,LITERAL_true);
				_t = _t.getNextSibling();
				_currentEXPR = new StringBuffer("true");
				break;
			}
			case LITERAL_false:
			{
				AST tmp95_AST_in = (AST)_t;
				match(_t,LITERAL_false);
				_t = _t.getNextSibling();
				_currentEXPR = new StringBuffer("false");
				break;
			}
			case LITERAL_this:
			{
				AST tmp96_AST_in = (AST)_t;
				match(_t,LITERAL_this);
				_t = _t.getNextSibling();
				_currentEXPR = new StringBuffer("this");
				break;
			}
			case LITERAL_null:
			{
				AST tmp97_AST_in = (AST)_t;
				match(_t,LITERAL_null);
				_t = _t.getNextSibling();
				_currentEXPR = new StringBuffer("null");
				break;
			}
			case TYPE:
			{
				typeSpec(_t);
				_t = _retTree;
				_currentEXPR = new StringBuffer(_typeName);
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void arrayIndex(AST _t) throws RecognitionException {
		
		AST arrayIndex_AST_in = (AST)_t;
		
		try {      // for error handling
			AST __t138 = _t;
			AST tmp98_AST_in = (AST)_t;
			match(_t,INDEX_OP);
			_t = _t.getFirstChild();
			_arrayIndexing = new StringBuffer();
			primaryExpression(_t);
			_t = _retTree;
			_arrayIndexing.append(_currentEXPR.toString() + "[");
			expression(_t);
			_t = _retTree;
			_arrayIndexing.append(_currentEXPR.toString() + "]");
			_t = __t138;
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void newExpression(AST _t) throws RecognitionException {
		
		AST newExpression_AST_in = (AST)_t;
		StringBuffer ret = new StringBuffer("new ");
		
		try {      // for error handling
			AST __t141 = _t;
			AST tmp99_AST_in = (AST)_t;
			match(_t,LITERAL_new);
			_t = _t.getFirstChild();
			type(_t);
			_t = _retTree;
			ret.append(_typeName);
			{
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case ARRAY_DECLARATOR:
			{
				_currentArrayDecl = new StringBuffer();
				newArrayDeclarator(_t);
				_t = _retTree;
				
								    ret.append(_currentArrayDecl.toString());
							
				{
				if (_t==null) _t=ASTNULL;
				switch ( _t.getType()) {
				case ARRAY_INIT:
				{
					arrayInitializer(_t);
					_t = _retTree;
					
									    ret.append("= " + _initializer.toString());
									
					break;
				}
				case 3:
				{
					break;
				}
				default:
				{
					throw new NoViableAltException(_t);
				}
				}
				}
				_currentEXPR = new StringBuffer(ret.toString());
				break;
			}
			case ELIST:
			{
				elist(_t);
				_t = _retTree;
				// (objBlock)?
							            ret.append("(");
				if(_exprList.size() > 0) {
						                       for(int i = 0;i < _exprList.size() - 1;i++) {
							                   ret.append((String) _exprList.get(i) + ",");
							                }
							                ret.append((String) _exprList.get(_exprList.size() - 1));
							            }
							            ret.append(")");
							            _currentEXPR = new StringBuffer(ret.toString());
				
				_exprList = (LinkedList) _exprStack.pop();
							
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
			}
			_t = __t141;
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void constant(AST _t) throws RecognitionException {
		
		AST constant_AST_in = (AST)_t;
		AST n1 = null;
		AST n2 = null;
		AST n3 = null;
		AST n4 = null;
		AST n5 = null;
		AST n6 = null;
		
		try {      // for error handling
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case NUM_INT:
			{
				n1 = (AST)_t;
				match(_t,NUM_INT);
				_t = _t.getNextSibling();
				_currentConst = n1.getText();
				break;
			}
			case CHAR_LITERAL:
			{
				n2 = (AST)_t;
				match(_t,CHAR_LITERAL);
				_t = _t.getNextSibling();
				_currentConst = n2.getText();
				break;
			}
			case STRING_LITERAL:
			{
				n3 = (AST)_t;
				match(_t,STRING_LITERAL);
				_t = _t.getNextSibling();
				_currentConst = n3.getText();
				break;
			}
			case NUM_FLOAT:
			{
				n4 = (AST)_t;
				match(_t,NUM_FLOAT);
				_t = _t.getNextSibling();
				_currentConst = n4.getText();
				break;
			}
			case NUM_DOUBLE:
			{
				n5 = (AST)_t;
				match(_t,NUM_DOUBLE);
				_t = _t.getNextSibling();
				_currentConst = n5.getText();
				break;
			}
			case NUM_LONG:
			{
				n6 = (AST)_t;
				match(_t,NUM_LONG);
				_t = _t.getNextSibling();
				_currentConst = n6.getText();
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void ctorCall(AST _t) throws RecognitionException {
		
		AST ctorCall_AST_in = (AST)_t;
		
		try {      // for error handling
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case CTOR_CALL:
			{
				AST __t134 = _t;
				AST tmp100_AST_in = (AST)_t;
				match(_t,CTOR_CALL);
				_t = _t.getFirstChild();
				elist(_t);
				_t = _retTree;
				_t = __t134;
				_t = _t.getNextSibling();
				break;
			}
			case SUPER_CTOR_CALL:
			{
				AST __t135 = _t;
				AST tmp101_AST_in = (AST)_t;
				match(_t,SUPER_CTOR_CALL);
				_t = _t.getFirstChild();
				{
				if (_t==null) _t=ASTNULL;
				switch ( _t.getType()) {
				case ELIST:
				{
					elist(_t);
					_t = _retTree;
					break;
				}
				case TYPE:
				case TYPECAST:
				case INDEX_OP:
				case METHOD_CALL:
				case IDENT:
				case DOT:
				case LITERAL_this:
				case LITERAL_super:
				case LITERAL_true:
				case LITERAL_false:
				case LITERAL_null:
				case LITERAL_new:
				case NUM_INT:
				case CHAR_LITERAL:
				case STRING_LITERAL:
				case NUM_FLOAT:
				case NUM_LONG:
				case NUM_DOUBLE:
				{
					primaryExpression(_t);
					_t = _retTree;
					elist(_t);
					_t = _retTree;
					break;
				}
				default:
				{
					throw new NoViableAltException(_t);
				}
				}
				}
				_t = __t135;
				_t = _t.getNextSibling();
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	public final void newArrayDeclarator(AST _t) throws RecognitionException {
		
		AST newArrayDeclarator_AST_in = (AST)_t;
		boolean hasEXPR = false;
		
		try {      // for error handling
			AST __t145 = _t;
			AST tmp102_AST_in = (AST)_t;
			match(_t,ARRAY_DECLARATOR);
			_t = _t.getFirstChild();
			{
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case ARRAY_DECLARATOR:
			{
				newArrayDeclarator(_t);
				_t = _retTree;
				break;
			}
			case 3:
			case EXPR:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
			}
			{
			if (_t==null) _t=ASTNULL;
			switch ( _t.getType()) {
			case EXPR:
			{
				expression(_t);
				_t = _retTree;
						       
							    _currentArrayDecl.append("[" + _currentEXPR.toString() + "]");
				hasEXPR = true;
						
				break;
			}
			case 3:
			{
				break;
			}
			default:
			{
				throw new NoViableAltException(_t);
			}
			}
			}
			
					            if(!hasEXPR) {
						       _currentArrayDecl.append("[]");			   
						    }
					
			_t = __t145;
			_t = _t.getNextSibling();
		}
		catch (RecognitionException ex) {
			reportError(ex);
			if (_t!=null) {_t = _t.getNextSibling();}
		}
		_retTree = _t;
	}
	
	
	public static final String[] _tokenNames = {
		"<0>",
		"EOF",
		"<2>",
		"NULL_TREE_LOOKAHEAD",
		"BLOCK",
		"MODIFIERS",
		"OBJBLOCK",
		"SLIST",
		"CTOR_DEF",
		"METHOD_DEF",
		"VARIABLE_DEF",
		"INSTANCE_INIT",
		"STATIC_INIT",
		"TYPE",
		"CLASS_DEF",
		"INTERFACE_DEF",
		"PACKAGE_DEF",
		"ARRAY_DECLARATOR",
		"EXTENDS_CLAUSE",
		"IMPLEMENTS_CLAUSE",
		"PARAMETERS",
		"PARAMETER_DEF",
		"LABELED_STAT",
		"TYPECAST",
		"INDEX_OP",
		"POST_INC",
		"POST_DEC",
		"METHOD_CALL",
		"EXPR",
		"ARRAY_INIT",
		"IMPORT",
		"UNARY_MINUS",
		"UNARY_PLUS",
		"CASE_GROUP",
		"ELIST",
		"FOR_INIT",
		"FOR_CONDITION",
		"FOR_ITERATOR",
		"EMPTY_STAT",
		"\"final\"",
		"\"abstract\"",
		"\"strictfp\"",
		"SUPER_CTOR_CALL",
		"CTOR_CALL",
		"\"package\"",
		"SEMI",
		"\"import\"",
		"LBRACK",
		"RBRACK",
		"\"void\"",
		"\"boolean\"",
		"\"byte\"",
		"\"char\"",
		"\"short\"",
		"\"int\"",
		"\"float\"",
		"\"long\"",
		"\"double\"",
		"IDENT",
		"DOT",
		"STAR",
		"\"private\"",
		"\"public\"",
		"\"protected\"",
		"\"static\"",
		"\"transient\"",
		"\"native\"",
		"\"threadsafe\"",
		"\"synchronized\"",
		"\"volatile\"",
		"\"class\"",
		"\"extends\"",
		"\"interface\"",
		"LCURLY",
		"RCURLY",
		"COMMA",
		"\"implements\"",
		"LPAREN",
		"RPAREN",
		"\"this\"",
		"\"super\"",
		"ASSIGN",
		"\"throws\"",
		"COLON",
		"\"if\"",
		"\"else\"",
		"\"for\"",
		"\"while\"",
		"\"do\"",
		"\"break\"",
		"\"continue\"",
		"\"return\"",
		"\"switch\"",
		"\"throw\"",
		"\"case\"",
		"\"default\"",
		"\"try\"",
		"\"finally\"",
		"\"catch\"",
		"PLUS_ASSIGN",
		"MINUS_ASSIGN",
		"STAR_ASSIGN",
		"DIV_ASSIGN",
		"MOD_ASSIGN",
		"SR_ASSIGN",
		"BSR_ASSIGN",
		"SL_ASSIGN",
		"BAND_ASSIGN",
		"BXOR_ASSIGN",
		"BOR_ASSIGN",
		"QUESTION",
		"LOR",
		"LAND",
		"BOR",
		"BXOR",
		"BAND",
		"NOT_EQUAL",
		"EQUAL",
		"LT",
		"GT",
		"LE",
		"GE",
		"\"instanceof\"",
		"SL",
		"SR",
		"BSR",
		"PLUS",
		"MINUS",
		"DIV",
		"MOD",
		"INC",
		"DEC",
		"BNOT",
		"LNOT",
		"\"true\"",
		"\"false\"",
		"\"null\"",
		"\"new\"",
		"NUM_INT",
		"CHAR_LITERAL",
		"STRING_LITERAL",
		"NUM_FLOAT",
		"NUM_LONG",
		"NUM_DOUBLE",
		"WS",
		"SL_COMMENT",
		"ML_COMMENT",
		"ESC",
		"HEX_DIGIT",
		"VOCAB",
		"EXPONENT",
		"FLOAT_SUFFIX",
		"\"const\""
	};
	
	private static final long _tokenSet_0_data_[] = { -2305839160922996736L, 63L, 16777216L, 0L, 0L, 0L };
	public static final BitSet _tokenSet_0 = new BitSet(_tokenSet_0_data_);
	}
	
